import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/barCode',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/barCode/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/barCode',
    method: 'put',
    data
  })
}

export function print(id, type) {
  return request({
    url: `api/barCode/print?id=${id}&type=${type}`,
    method: 'get'
  })
}

export function showBarCode(data) {
  return request({
    url: 'api/barCode/showBarCode',
    method: 'get',
    data
  })
}

export function printCode (params) {
  return request({
    url: '/api/printerTask/query',
    method: 'get',
    params
  })
}

export function printBatchCode (params) {
  return request({
    url: '/api/printerTask/batchCreate',
    method: 'get',
    params
  })
}

export default { add, edit, del, print }
